home *** CD-ROM | disk | FTP | other *** search
- From: Tendrils@msn.com (kelvin )
- Subject: RE: Beginner: How to #include
- Date: 31 Jan 96 09:13:34 -0800
- References: <west.32.008AC8C0@emt.e-technik.tu-muenchen.de>
- Message-ID: <00001a81+0000973a@msn.com>
- Path: news.msn.com!msn.com
- Newsgroups: comp.lang.c++
- Organization: The Microsoft Network (msn.com)
-
- Generally, it is best to put #includes in .cpp files
-
- my_data.h:
- ----------
- class CPicture; // forward declaration
-
- class A
- {
- ..
- CPicture m_picture;
- ...
- }
-
-
-
- my_program.cpp:
- ---------------
- #include "my_data.h"
-
- Also,
-
- it is a very good practice to put the following two statements
- at the top of the .h file
-
- #ifndef _MY_DATA_H_
- #define _MY_DATA_H_
-
- and the following statement at the last line of the .h file
- #endif
-